<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
			window.onload = function(){
				var oA = document.getElementsByTagName('a')[0];
				oA.onclick = function(ev){
					var ev = window.event || ev;
					
					ev.returnValue = false;
					ev.preventDefault();
				}
				
				var oForm = document.getElementsByTagName('form')[0];
				
				oForm.onsubmit = function(ev){
					var ev = window.event || ev;
					console.log('提交');
					ev.returnValue = false;
					ev.preventDefault();
				}
			}
		</script>
	</head>
	<body>
		<a href="">百度</a>
		<form action="">
			<input type="submit" value="提交" />
		</form>
	</body>
</html>
